Create User
POST apps/api/user
Headers:
- Authorization:
Bearer {access_token}— Replace{access_token}with the token obtained from Step 1. - Content-Type: application/json
{
"phoneNumber" : "966583944460",
"firstName" : "Name",
"lastName" : "Family",
"nationalId": "2211111122",
"iBAN": "8995422365998855663",
"dateOfBirth": "2000-01-01T10:27:39.889Z",
"callbackUrl": "https://your-callback-url.com"
}
Field Descriptions​
| Field Name | Type | Description | Required / Notes / Example |
|---|---|---|---|
| phoneNumber | string | User phone number | Required |
| firstName | string | User first name | Required |
| lastName | string | User last name | Required |
| nationalId | string | User national id | Optional |
| iBAN | string | User bank account iban | Optional |
| dateOfBirth | datetime | User date of birth | Optional |
| callbackUrl | string | URL to receive callbacks | Optional |
Example Request (cURL)​
curl --location 'https://api.wepay.com.sa/apps/api/user' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--data '{
"phoneNumber" : "966583944460",
"firstName" : "Name",
"lastName" : "Family",
"nationalId": "2211111122",
"iBAN": "8995422365998855663",
"dateOfBirth": "2000-01-01T10:27:39.889Z",
"callbackUrl": "https://your-callback-url.com"
}'
Example Response​
{
"data": {
"platformRefId": "USR_123",
"kyc":
{
"url": "https://integration.wepay-sa.com/kyc?isVerified=true&isKycCompleted=false
&isBankAccountReady=true&callbackUrl=https://your-callback-url.com&token=encodedToken",
"token": "encodedToken",
"expiresAt": "2024-06-30T10:27:39.889Z"
}
},
"message": "User created successfully.",
"status": 200,
"validationErrors": []
}
Response Fields:
| Field | Type | Description |
|---|---|---|
| platformRefId | string | Unique identifier for the user in the WePay system |
| kyc | Object | An object containing the KYC verification URL and related information |
KYC
| Field Name | Type | Description |
|---|---|---|
| url | string | redirect URL to complete KYC |
| token | string | encodedToken |
| expiresAt | datetime | token expiration time |